global ques, cdname, buttontype, sizetype, fonttype, answertype, aligntype
put script of card fld "definition" into zig
set lockscreen to true
go to card full
if cd fld "problem" is empty then
answer "You must define the problem to work on" with "OK"
domenu "new card"
domenu "new field"
set the name of cd fld "" to "define"
set the style of cd fld "define" to scrolling
choose button tool
domenu "new button"
set name of card button "new button" to "finished"
set rect of card button "finished" to 229,330,303,342
set script of card button "finished" to zig
choose browse tool
answer "Define you problem in the following field" with "OK"
answer "Click finished when done"
click at 246,131
exit mouseUp
end if
go to card default
answer "Are you happy with the default settings" with "No" or "YES"
if it is "No" then
answer "Then change them" with "OK"
hide card button "To Tree"
exit mouseUp
end if
go to card build
set the loc of the msg box to 30,217
put "WORKING..." into msg box
put the script of card fld "finished" into p
go to card default
put the long name of this stack into temp
put Resources("FONT",temp) into rss
put card fld button into buttontype
put card fld size into sizetype
put card fld font into fonttype
put card fld answers into answertype
go to card "full"
put the short name of this card into cdname
go to last card
domenu "new card"
choose text tool
set textAlign to left
set textSize to 24
set textStyle to bold, underline
click at 10,44
type "Question:"
choose button tool
domenu "new button"
set name of card button "new button" to "finished"
set rect of card button "finished" to 229,330,303,342
set script of card button "finished" to p
choose browse tool
put 1 into ques
put ques into card fld ques1 of card full
set the name of this card to "ques1"
domenu "new field"
set the name of card fld "" to "funny"
set the textAlign of card fld "funny" to aligntype
set the style of card fld funny to scrolling
hide msg box
answer "Type your question in the following field" with "OK"
answer "Click the finished button when done" with "OK"
choose browse tool
click at 246,131
hide msg box
end mouseUp
-- part 2 (field)
-- low flags: 80
-- high flags: 0004
-- rect: left=6 top=330 right=342 bottom=18
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: finished
----- HyperTalk script -----
on mouseUp
global x, ques, ans, qc, fdl, inum, cdname, buttontype, fonttype, sizetype, answertype, aligntype
put cd fld "funny" into x
if x is empty then
answer "You havent typed a question!" with "OK"
exit mouseUp
end if
put id of this card into inum
set lockscreen to true
set the loc of msg box to 23,208
put "WORKING..." into msg box
go to card "full"
put 1 into card fld "cd count"
put 1 into card fld "ans count"
put 0 into card fld "con count"
put 0 into card fld dqcount
put 0 into card fld dccount
put "Question" into card fld "label1"
domenu "new field"
set the name of card fld "" to inum
put x into card fld inum
set the lockText of card fld inum to true
set the style of card fld inum to scrolling
set the lockText of card fld inum to true
set the script of card fld inum to "on mouseUp" &return&"hide me"&return&"end mouseUp"
hide card fld inum
domenu "new button"
set the rect of card btn "new button" to 4,122,68,164
set the loc of card btn "new button" to 36,143
set the rect of card btn "new button" to 4,122,68,164
set the showName of cd btn "new button" to false
set the style of cd btn "new button" to transparent
set the script of card btn "new button" to "on mouseUp" &return&"show card fld ""e&inum"e &return&"end mouseUp"
set the name of card btn "new button" to inum
domenu "back"
set lockscreen to false
hide msg box
if aligntype is empty then
ask "What type of alignment do you want?" with "Center"
put it into al
else
put aligntype into al
end if
if fonttype is empty then
ask "What type of font do you want?" with "Helvetica"
put it into ft
else
put fonttype into ft
end if
if sizetype is empty then
ask "What size font do you want?" with "24"
put it into wer
else
put sizetype into wer
end if
domenu "new field"
set the name of card fld "" to "ha"
set the style of card fld "ha" to scrolling
set the rect of card fld "ha" to 6,61,507,200
set the textFont of card fld "ha" to ft
set the textSize of card fld "ha" to wer
set the textAlign of card fld "ha" to al
hide card fld "funny"
put card fld "funny" into card fld "ha"
if buttontype is empty then
ask "What type of button do you want?" with "shadow"
put it into btntyp
else
put buttontype into btntyp
end if
choose button tool
put 2 into fun
repeat 2 times
domenu "new button"
set the style of card button fun to btntyp
add 1 to fun
end repeat
if answertype = "Variable" or answertype is empty then
ask "What is answer number 1" with "6 letters max/Yes or No"
put it into xx1
put the number of characters of xx1 into zip
if zip > 6 then
beep 1
repeat until zip Γëñ 6
beep 1
ask "What is answer number 1" with "6 letters max/Yes or No"
put it into xx1
put the number of characters of xx1 into zip
end repeat
end if
set the name of card button "new button" to xx1
ask "What is answer number 2" with "6 letters max/Yes or No"
put it into yy1
put the number of characters of yy1 into zip
if zip > 6 then
beep 1
repeat until zip Γëñ 6
beep 1
ask "What is answer number 2" with "6 letters max/Yes or No"
put it into yy1
put the number of characters of yy1 into zip
end repeat
end if
set the name of card button "new button" to yy1
end if
if answertype = "True-False" then
set the name of card button "new button" to "True"
set the name of card button "new button" to "False"
put "True" into xx1
put "False" into yy1
end if
if answertype = "A-B" then
set the name of card button "new button" to "A"
set the name of card button "new button" to "B"
put "A" into xx1
put "B" into yy1
end if
if answertype = "Yes-No" then
set the name of card button "new button" to "Yes"
set the name of card button "new button" to "No"
put "Yes" into xx1
put "No" into yy1
end if
set the loc of card button 2 to 176,253
set the loc of card button 3 to 337,253
wait 100
answer "Does that look alright" with "No" or "Yes"
if it is "No" then
tones
end if
go to card cdname
put xx1 into card fld "yes1"
put yy1 into card fld "no1"
choose browse tool
hide me
answer "Click on a answer field to continue (i.e Y-N)"
end mouseUp
on tones
global x, aligntype, buttontype, answertype, fonttype, sizetype
put empty into card fld "ha"
select card button 2
domenu "clear button"
select card button 2
domenu "clear button"
choose select tool
put card fld fonttypes of card default into ft
put card fld fontsize of card default into st
put card fld buttontypes of card default into bt
answer "Choose type of font do you want?" with "OK"
DoList 999,ft,one
if the result is empty then
put "Geneva" into ft
else
put item 2 of the result into ft
end if
answer "Choose size of font do you want?" with "OK"
DoList 999,st,one
if item 2 of the result is empty then
put 24 into st
else
put item 2 of the result into st
end if
set the textFont of card fld "ha" to ft
set the textSize of card fld "ha" to st
answer "Align the field: Left, Right, Center" with "Left" or "Right" or "Center"
if it is "Left" then
set textAlign of card fld "ha" to left
end if
if it is "Right" then
set textAlign of card fld "ha" to right
end if
if it is "Center" then
set textAlign of card fld "ha" to center
end if
answer "Choose type of button do you want?" with "OK"
DoList 999,bt,one
if item 2 of the result is empty then
put "Shadow" into bt
else
put item 2 of the result into bt
end if
choose button tool
put 2 into fun
repeat 2 times
domenu "new button"
set the style of card button fun to bt
add 1 to fun
end repeat
set the loc of card button 2 to 176,253
set the loc of card button 3 to 337,253
ask "What is answer number 1" with answertype
put it into xx1
put the number of characters of xx1 into zip
if zip > 6 then
beep 1
repeat until zip Γëñ 6
beep 1
ask "What is answer number 1" with "6 letters max"
put it into xx1
put the number of characters of xx1 into zip
end repeat
end if
set the name of card button "new button" to xx1
ask "What is answer number 2" with answertype
put it into yy1
put the number of characters of yy1 into zip
if zip > 6 then
beep 1
repeat until zip Γëñ 6
beep 1
ask "What is answer number 2" with "6 letters max"
put it into yy1
put the number of characters of yy1 into zip
end repeat
end if
set the name of card button "new button" to yy1
put card fld "funny" into card fld "ha"
wait 100
answer "Does that look alright" with "Yes" or "No"
if it is "no" then
tones
end if
if xx1 = yy1 then
answer "You cannot have two buttons with the same names" with "OK"
tones
end if
end tones
-- part 9 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=148 top=214 right=257 bottom=384
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Make Default Settings
----- HyperTalk script -----
on mouseUp
go to card default
hide card btn "To Tree"
end mouseUp
-- part 11 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=33 top=330 right=342 bottom=45
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: definition
----- HyperTalk script -----
on mouseUp
if card fld "define" is empty then
answer "Thats not much of a problem!"
exit mouseUp
end if
put cd fld "define" into troy
domenu delete card
go to card default
set lockscreen to true
go to cd "full"
put troy into card fld "problem"
go to card "build"
get the loc of card button "Build Expert System"
click at it
end mouseUp
-- part 12 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=0 top=277 right=342 bottom=75
-- title width / last selected line: 0
-- icon id / first selected line: 14767 / 14767
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: About
----- HyperTalk script -----
on mouseUp
show card fld about
set scroll of card fld about to 1
end mouseUp
-- part 14 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=424 top=273 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 1020 / 1020
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Help
----- HyperTalk script -----
on mouseUp
show card fld help
set the scroll of card fld help to 1
end mouseUp
-- part 16 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=240 top=323 right=342 bottom=286
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Quit
----- HyperTalk script -----
on mouseUp
go home
end mouseUp
-- part 13 (field)
-- low flags: 81
-- high flags: 0007
-- rect: left=0 top=0 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: about
----- HyperTalk script -----
on mouseUp
hide me
end mouseUp
-- part 15 (field)
-- low flags: 81
-- high flags: 0007
-- rect: left=0 top=0 right=342 bottom=512
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: help
----- HyperTalk script -----
on mouseUp
hide me
end mouseUp
-- part contents for card part 13
----- text -----
This stack is designed to be a pseudo expert system shell** . This stack enables the expert to set up a "binomial decision tree" and work through questions on the way to a conclusion about a particular problem which end users may have. Primarily this stack serves as an overview of the decision tree. Each question the expert askes corresponds to each branch of the tree or each card in the solution stack. The stack that the expert has created, the solution stack, is then added to a ExpertMenu Stack, which this stack creates. The created problem or solution stacks, and the ExpertMenu Stack, are then given to the end users, or the people trying to solve a particular problem. The expert keeps this stack, which is a shell, for solving other problems.
For more info and a quick way to get started, click on the help button.
Please distribute this stack to as many experts as you can possibly find, or all this work will have been for nothing!!!!
© Copyright 1990 Troy Kelley
Developed at the Human Factors Engineering Laboratory
Aberdeen Proving Ground, Aberdeen Md 21005-5001
send problems to: tkelley@hel4.brl.mil
301-278-5817
Developed with the aid of the Developer Stack.
To receive the latest version of the Developer Stack, send $10.00 to:
AnalytX
Box 388
Southampton, PA 18966
**It is not an expert system in the true sense of the term, since it does not do any heuristic reasoning, that was not it's intent. It was intended to be very easy to use and enable an expert to create something on his own, without the aid of computer programmers, and without spending an enormous amount of time. Also, heuristic reasoning can occasionally come to a wrong conclusion, whereas with this stack, the expert knows all of the conclusions to all of the questions, so there are no wrong conclusions.
-- part contents for card part 15
----- text -----
HyperExpert Help - click on field to close it
***Load this stack onto your Hard disk, or it will run very slow and may not work properly. Use HyperCard and not SuperCard. I have experienced some problems with this stack while using SuperCard.***
***Choose the "About Box" on this card to see the goals and purpose of this stack***
-------------For those of you who can't wait to get started.--------------
Step 1 - First click on the button "Build Expert System"
Step 2 - It will ask you to define the problem to be worked on. This is the
problem that the end users are having. For Example - My car won't
start. Common questions or problems which get asked frequently
is one way to think of it.
Step 3 - Set Defaults. The HyperExpert Stack is designed to make setting
up your system as quick and easy as possible. The defaults are
so you can set your cards how you want them to look one time,
and then you wont have to do it again. Like all Yes-No questions.
Step 4 - After setting defaults you will have to click on the "Build Expert
System" button again to get started.
Step 5 - Now you start your questioning to come to a conclusion about
the problem. For example, if your problem is "My car wont start"
then a good first question would be "Did you check the gas tank".
You enter it in the proper field and click finished when done.
Step 6 - Now your at the tree portion of the stack. IF YOU CLICK ON THE
QUESTION 1 BOX YOU CAN SEE THE QUESTION YOU JUST TYPED. You
can also see the answers you have assigned for Question 1
(i.e Yes, No). Now click on the answer to the question you
would like to work with next. For example - your question was
"Did you check the gas tank" and if they
answer "No" you want to reach a conclusion at that point.
So click on the "No" answer box next to the box labeled
Question 1.
Step 7 - After clicking on the "No" box of Question 1 HyperExpert will ask
if you want a question or a conclusion. If you choose
conclusion, HyperExpert will ask you if you want the conclusion
to go to another question. For example you might have another
question you might want to ask even though you have reached
one conclusion already. Simply enter the question number here.
Step 8 - Now type your conclusion, like "You should check your gas tank"
click finished when done.
Step 9 - Now if your satisfied with all of your questions and conclusions
click "Save System" and HyperExpert will begin to look for
the stack "ExpertMenu". If this is the first time you have used
HyperExpert it will not find the stack and will ask you to make a
new one. When the new stack window comes up click on the save
button and don't change the name of the stack. You also need to
name your question stacks. You may call these whatever you like.
These are the stacks that the ExpertMenu Stack references.
Step 10 - Your finished. Now give the ExpertMenu stack
and the question stacks you created to the people who need your
expertise. This may have sounded like a lot of steps but
after using this stack once or twice it becomes very intuitive.
Remember you can make the system as big as the memory and
disk space of your own Mac will allow.
You keep the HyperExpert Shell Stack for creating other systems.
**A word of advise, make sure all of your questions eventually
end with a conclusion, or your users may end up going down
a path to no conclusion.
**Note there is an edit button included on the ExpertMenu Stack.
This allows anyone to remove the files you have created. You
may want to remove this button, but it is up to you. It is
primarily for your use.
**Button Functions**
**Build Expert System**
Obviously is the first button you click on to get the process of building your system started.
**Clear Tree**
This button clears out the tree and the question cards that you have created. It is to be used if you have already saved the system or made some type of error that made it necessary to get rid of the entire system.
**Default Settings**
This button takes you to the area where you can decide what type of default settings you would like to have for your individual question cards
**Edit**
This button allows you to edit a question after you have created it. If the question is in the middle of the tree (i.e. there are other questions after it), then a replacement question must be created. If the question is at the end of the tree and there are no other questions after it, then it can be delete without having to replace the question.
There is an edit button on the ExpertMenu stack. It will delete the solution stack of your choice. You may decide to remove this button before you give it to your end users. It's up to you.
**Set Answer Types**
This is a popup menu which gives you a choice of answer types to set as a default. For example -- Yes-No, True-False. After setting this default all of your answer types will be of this kind. Notice there is a Variable answer type for answers which don't fit into one of the given categories.
**Set Button Types**
This is a popup menu which gives you the standard Hypercard choices for button types.
**Set Font Size**
This is a popup menu which sets the font size of the field containing your answer or question.
**Set Font Types**
This is a list menu generated by the Dolist XCMD. It loads all the fonts you have available in your system and gives you the choice of which font you want to use for the field your question or conclusion is contained.
**Set Text Align**
This is a popup menu which allows you to choose a type of alignment (left, right, center) for the field which contains your question or conclusion.
**Save System**
This button saves your questions and conclusions to a separate stack. It will prompt you to name your stack and if you have not created an ExpertMenu stack you will be prompted to do that as well.
**Field Information**
**Deleted Conclusions**
This field shows the conclusion numbers you have deleted. HyperExpert re-uses these numbers until the field contains a zero and then it starts numbering from the last conclusion.
**Deleted Questions**
This field shows the question numbers you have deleted. HyperExpert re-uses these numbers until the field contains a zero and then it starts numbering from the last question.
**Name of Problem**
Obviously this is the name of the problem you defined in the beginning.
**Total Cards**
This is the total number of TREE cards. For instance if you fill up the tree card will all seven questions then add an eighth question, you would then be starting another tree card, so at that point you would have 2 tree cards or 2 total cards.
**Total Questions**
This is the total number of questions not counting conclusions.
**Total Conclusions**
This is the total number of conclusions not counting questions.